package ac.svn.accesscontrol.ui.panel;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import ac.svn.accesscontrol.ui.WhiteLabel;
import ac.svn.accesscontrol.utils.UIUtility;
import ac.svn.accesscontrol.utils.Utility;

public class SVNItemPanel extends JPanel {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private JButton btnDelete;
    private String strOwner ="",strMember="";

    public SVNItemPanel(String title,String imageUrl)
    {
	super(true);

	setBorder(UIUtility.setAllShadowedBorder(null));
	setBackground(Color.WHITE);
	setLayout(new BorderLayout(20, 0));

	WhiteLabel lblIcon = new WhiteLabel(Utility.getImageIcon(imageUrl));
	lblIcon.enableShadow(true);
	lblIcon.setPreferredSize(new Dimension(32, 32));
	add(lblIcon, BorderLayout.WEST);

	WhiteLabel lblName = new WhiteLabel(title);
	lblName.setHorizontalAlignment(SwingConstants.CENTER);
	add(lblName, BorderLayout.CENTER);

	btnDelete = new JButton("x");
	add(btnDelete, BorderLayout.EAST);

	btnDelete.addActionListener(new ActionListener() {

	    @Override
	    public void actionPerformed(ActionEvent arg0) {
		setVisible(false);
	    }
	});
    }
    public String getStrOwner() {
	return strOwner;
    }
    public void setStrOwner(String strOwner) {
	this.strOwner = strOwner;
    }
    public String getStrMember() {
	return strMember;
    }
    public void setStrMember(String strMember) {
	this.strMember = strMember;
    }
    public JButton getBtnDelete() {
	return btnDelete;
    }


}
